import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '作业许可范围及作业环境',
    align:"center",
    dataIndex: 'jobEnvironment'
   },
   {
    title: '防范措施（工艺、设备、个体防护等）',
    align:"center",
    dataIndex: 'preventiveMeasures'
   },
   {
    title: '应急措施',
    align:"center",
    dataIndex: 'emergencyMeasure'
   },
   {
    title: '其他注意事项',
    align:"center",
    dataIndex: 'attentionItem'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'deleted_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "作业许可范围及作业环境",
      field: 'jobEnvironment',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "防范措施（工艺、设备、个体防护等）",
      field: 'preventiveMeasures',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "应急措施",
      field: 'emergencyMeasure',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "其他注意事项",
      field: 'attentionItem',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "状态",
      field: 'deleted',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"normalOrStop"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '作业许可范围及作业环境',
    field: 'jobEnvironment',
    component: 'InputTextArea',
  },
  {
    label: '防范措施（工艺、设备、个体防护等）',
    field: 'preventiveMeasures',
    component: 'InputTextArea',
  },
  {
    label: '应急措施',
    field: 'emergencyMeasure',
    component: 'InputTextArea',
  },
  {
    label: '其他注意事项',
    field: 'attentionItem',
    component: 'InputTextArea',
  },
  {
    label: '状态',
    field: 'deleted',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"normalOrStop",
        type: "radio"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  jobEnvironment: {title: '作业许可范围及作业环境',order: 0,view: 'textarea', type: 'string',},
  preventiveMeasures: {title: '防范措施（工艺、设备、个体防护等）',order: 1,view: 'textarea', type: 'string',},
  emergencyMeasure: {title: '应急措施',order: 2,view: 'textarea', type: 'string',},
  attentionItem: {title: '其他注意事项',order: 3,view: 'textarea', type: 'string',},
  deleted: {title: '状态',order: 4,view: 'radio', type: 'string',dictCode: 'normalOrStop',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}